const signature = require('./signature');

var createSignature;

function asyncSignature(config){
	createSignature = signature.getSignature({appId: config.appId,appSecret: config.appSecret,appToken: config.appToken});
}

asyncSignature.prototype.sign = function(url){
	return new Promise((resolve, reject) => {
        createSignature(url,function(error, result){
            if(error){
                reject(error);
            } else {
                resolve(result)
            }
        });
    })
}

asyncSignature.prototype.mm = function(){
	console.log("ss");
}

module.exports = asyncSignature;